//
//  LWCommonTools.swift
//  LW_Weibo
//
//  Created by 刘伟 on 16/7/12.
//  Copyright © 2016年 LWSpro. All rights reserved.
//

import UIKit


//全局的常量
//频宽
let SCreenWidth = UIScreen.mainScreen().bounds.size.width

//频高
let SCreenHeight = UIScreen.mainScreen().bounds.size.height

//发送通知用的通知名 欢迎页面
let SwitchRootVCNotification = "SwitchRootVCNotification"


//  点击表情按钮发送的通知名
let ClickSeletedEmotionButtonNotification = "ClickSeletedEmotionButtonNotification"
//  删除表情按钮点击发送的通知名
let ClickSelecteDeleteEmoticonButtonNotification = "ClickSelecteDeleteEmoticonButtonNotification"

//设置一个全局的方法
//抽取RGB函数 设置颜色
func RGB(red: CGFloat, green: CGFloat, blue: CGFloat) -> UIColor {
    
    
    return UIColor(red: red, green: green, blue: blue, alpha: 1)

    
}



//随机色
func RandomColor() -> UIColor {
    
    //获取随机产生的色值
    let red = random() % 256
    let green = random() % 256
    let blue = random() % 256
    
    return RGB(CGFloat(red) / 255, green: CGFloat(green) / 255, blue: CGFloat(blue) / 255)
    
    
}



//  如果函数参数提供默认值,则可以省略不传入这个参数
func printLog(file: String = __FILE__, funcName: String = __FUNCTION__, line: Int = __LINE__) {
    //    __FUNCTION__ // swift 3.0 改成#function
    //    __LINE__     //             #line
    //    __FILE__    //                 #file
    //
    
    #if DEBUG
        
        print("\((file as NSString).lastPathComponent)[\(line)], \(funcName)")
        
        
    #endif
    
    
}

